package scrolls;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;

public class Inventory
{
	static boolean openInvent = false;

	public static void createInventory(Graphics2D g2d)
	{
		if (openInvent)
		{
			g2d.setColor(Color.decode("0x815713"));
			g2d.fillRect(517, 0, 300, 448);

			g2d.setColor(Color.BLACK);
			g2d.drawRect(517, 0, 300, 448);

			g2d.setFont(Resources.f);
			g2d.setColor(Color.BLACK);
			g2d.drawString("Stats", 667 - (2 * 22), 50);

			g2d.drawRect(517, 0, 300, 224);
			g2d.drawString("Items", 667 - (2 * 22), 250);
			g2d.drawLine(517, 260, 817, 260);
		}
	}

	static void collision(Graphics2D g2d)
	{
		Rectangle inv = HUD.inventoryRect();
		Rectangle mouse = Input.mouseRect();
		if (inv.intersects(mouse))
		{
			g2d.draw(inv);
		}
		createInventory(g2d);
	}

	static void openInv()
	{
		Rectangle inv = HUD.inventoryRect();
		Rectangle mouse = Input.mouseRect();
		if (inv.intersects(mouse) && openInvent == true)
		{
			openInvent = false;
		} else if (inv.intersects(mouse) && openInvent == false)
		{
			openInvent = true;
		}
	}

}
